<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<style>
</style>
<script type="text/javascript">
    $(function() {
    	$('#sqlExcelReportEditForm [name=type]').change(function(){
    		var text=$('[name=type] option:selected','#sqlExcelReportEditForm').text();
    		$('#sqlExcelReportEditForm [name=typeName]').val(text);
    	})
        $('#sqlExcelReportEditForm').form({
            url : '${path}/sqlExcelReport/edit',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    showMsg(result.msg);
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    var form = $('#sqlExcelReportEditForm');
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow-x:hidden;overflow-y: auto;padding: 3px;">
        <form id="sqlExcelReportEditForm" method="post">
             <table class="grid">
                    <tr>
                     <td>名称</td>
                      <td>
<input type="hidden" name="id" value="${sqlExcelReport.id}">
                        <input name='name' value="${sqlExcelReport.name }"   type='text' placeholder='请输入名称' class='easyui-text-2  span2 easyui-validatebox' data-options="required:true" >
                     </td>
                      <td>顺序</td>
                      <td>
                        <input name='seq' value="${sqlExcelReport.seq }"  type='number' placeholder='请输入顺序' class='easyui-text-2  span2 easyui-validatebox' data-options="required:true"  >
                     </td>
                  </tr> <tr>
                     <td>类型</td>
                      <td>
                      <select name="type" class='easyui-text-2 easyui-validatebox' data-options="required:true">
                      	<option value="">请选择</option>
                      	<c:forEach var="type" items="${types}">
                      	  <option value="${type.id }" <c:if test="${sqlExcelReport.type==type.id}">selected</c:if>>${type.name }</option>
                      	</c:forEach>
                      </select>
                        <input name='typeName'  type='hidden' placeholder='请输入类型名称' class='easyui-text-2  span2' value="${sqlExcelReport.typeName }">
                      </td>
                     <td>
                         数据库类型
                     </td>
                     <td>
                         <select name="dbType" class="easyui-text-2">
                             <option value="mysql" <c:if test="${sqlExcelReport.dbType=='mysql'}">selected</c:if>>mysql</option>
                             <option value="oracle" <c:if test="${sqlExcelReport.dbType=='oracle'}">selected</c:if>>oracle</option>
                             <option value="sqlServer" <c:if test="${sqlExcelReport.dbType=='sqlServer'}">selected</c:if>>sqlServer</option>
                         </select>
                     </td>
                     </tr>

            </table>
        </form>
    </div>
</div>